package com.szholly.pro.watergas_server.ps.data;

import java.util.HashMap;

import org.springframework.stereotype.Component;

import com.szholly.data.general.metadata.table.DefulatDomainTable;
import org.springframework.stereotype.Component;

import com.szholly.data.general.Field;
import com.szholly.data.general.InterceptorTableBase;
import com.szholly.data.general.metadata.IBaseTable;
import com.szholly.utils.spring.SpringBeanFactory;
import org.springframework.stereotype.Component;
import com.szholly.data.general.GlobalDataType;
import com.szholly.data.general.RowBase;


/**
 * OperationDataAbnormal
 */
@Component("OperationDataAbnormal")
public class OperationDataAbnormalTable extends InterceptorTableBase  implements IBaseTable{

	public final static String TABLE_NAME = "OPERATION_DATA_ABNORMAL";
	
	/**
	 * single ref
	 */
	public static OperationDataAbnormalTable getSingleRef() {
		return (OperationDataAbnormalTable) SpringBeanFactory.getBean("OperationDataAbnormal");
	}

	@Override
	public String getMetadataTableName() {
		return TABLE_NAME;
	}

	@Override
	public String getMetadataTableAliasName() {
		return "OperationDataAbnormal";
	}

	private HashMap<String, Field> fields;

	@Override
	protected HashMap<String, Field> fields() {
		if (fields == null) {
			fields = new HashMap<String, Field>();

			Field itemField = new Field();
			itemField.setFieldName(RowBase.FIELD_GUID);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(1);
			itemField.setFieldAliasName("GUID");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationDataAbnormalRow.FIELD_StartTime);
			itemField.setDataType(GlobalDataType.DateTime);
			itemField.setFieldID(5);
			itemField.setFieldAliasName("START_TIME");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationDataAbnormalRow.FIELD_Status);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(6);
			itemField.setFieldAliasName("STATUS");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationDataAbnormalRow.FIELD_EndTime);
			itemField.setDataType(GlobalDataType.DateTime);
			itemField.setFieldID(7);
			itemField.setFieldAliasName("END_TIME");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationDataAbnormalRow.FIELD_DataReason);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(8);
			itemField.setFieldAliasName("DATA_REASON");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationDataAbnormalRow.FIELD_Guid);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(9);
			itemField.setFieldAliasName("GUID");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationDataAbnormalRow.FIELD_TreatResult);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(10);
			itemField.setFieldAliasName("TREAT_RESULT");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationDataAbnormalRow.FIELD_TaskCode);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(11);
			itemField.setFieldAliasName("TASK_CODE");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationDataAbnormalRow.FIELD_StationId);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(12);
			itemField.setFieldAliasName("STATION_ID");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationDataAbnormalRow.FIELD_Remark);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(13);
			itemField.setFieldAliasName("REMARK");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationDataAbnormalRow.FIELD_ExceptionCode);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(14);
			itemField.setFieldAliasName("EXCEPTION_CODE");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
		}
		return fields;
	}

	@Override
	public String getTableGroup() {
		return "OperationDataAbnormal";
	}
}